package com.hj.ipproxy.thread;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class ThreadMain {
	private static List<Integer> list = new LinkedList<>();

	public static void main(String[] args) throws InterruptedException {
		System.out.println("123"=="123");
		
		//test1();
		/*int len = 30;
		final ThreadMain tm  =  new ThreadMain();
		for (int i = 1; i <= len; i++) {
			final Auild a = new Auild();
			final int idx = i;
			new Thread(new Runnable() {
				@Override
				public void run() {
					a.handle(idx, tm);
					//a.add();
				}
			}).start();
			//System.out.println("循环"+idx+a);
		}
		System.out.println("开始等待");
		synchronized (tm) {
			tm.wait();	
			System.out.println(list.size());
			for (int i : list) {
				System.out.println(i);
			}
		}*/
	}
	
	private static void test1() {
		final Build bd = new Build();
		new Thread(new Runnable() {
			@Override
			public void run() {
				for (int i = 1; i <= 50; i++) {
					bd.sub(i);
				}
				
			}
		}).start();
		for (int i = 1; i <= 50; i++) {
			bd.main(i);
		}
	}

	public synchronized void add(int i){
		list.add(i);
	}
}
